home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
047a
/
probots.arj
/
SUBMINI.PR
< prev
next >
Wrap
Text File
|
1988-11-05
|
848b
|
32 lines
PROCEDURE SubMini;
{ Based on C-Robot HAK3 (Hunter-Killer III a.k.a. Submini)
by John Hardin
Strategy: Subminimal robot program. Scan the arena in 85 degree
increments (precession will ensure we scan the entire
arena). If we see a robot, charge at it firing continuously.
Don't worry about taking hits.
This robot is suicidal and fratricidal, but effective. }
VAR
dir : Integer;
Range : Integer;
BEGIN { SubMini main }
dir := 0;
REPEAT { Until Dead or Winner }
drive(dir, 50); { max speed that can still turn }
WHILE (scan(dir, 10) > 0) DO cannon(dir, scan(dir, 10)); { shoot at foe. }
dir := dir+85; { keep scanning }
UNTIL Dead OR Winner;
END; { end of SubMini main }